package com.sunbeam.junit;

import static org.junit.Assert.*;

import java.util.Date;

import org.junit.Test;

import com.sunbeam.dao.UserDao;
import com.sunbeam.dao.impl.UserDaoImpl;
import com.sunbeam.domain.User;

/**
 * @Title: UserDaoTest.java
 * @Package com.sunbeam.junit
 * @Description: TODO
 * @author lyz lyzpoq_gmail_com
 * @date 2014/02/11 11:21:44
 * @version V1.0
 */
public class UserDaoTest {
	
	@Test
	public void testAdd(){
		User user=new User();
		user.setBirthday(new Date());
		user.setEmail("bb@sina.com");
		user.setId("7685768787980");
		user.setNickname("旺财");
		user.setPassword("123");
		user.setUsername("bbb");
		UserDao dao=new UserDaoImpl();
		dao.add(user);
		
	}
	
	@Test
	public void testFind(){
		UserDao dao=new UserDaoImpl();
		User user=dao.find("aa", "1233");
		assertNull(user);
	}

	@Test
	public void testFindByUsername(){
		UserDao dao=new UserDaoImpl();
		boolean b=dao.find("aadd");
		assertTrue(b);
	}
}

